import request from '@/utils/request'

export default {
  // 条件查询带分页查询课程
  getCourseList(current, size, courseFrontQuery) {
    return request({
      url: `/api/courses/getFrontCourseList/${current}/${size}`,
      method: 'post',
      data: courseFrontQuery
    })
  },
  // 查询所有课程分类
  getAllSubject() {
    return request({
      url: `/api/courses/listSubject`,
      method: 'get'
    })
  },

  // 课程详情
  getCourseInfo(courseId, userId = null) {
    return request({
      url: `/api/courses/getFrontCourseInfo/${courseId}`,
      method: 'get',
      params: userId ? {userId} : {}
    })
  }

}
